﻿using System;

namespace ConsoleApp2
{
    //11.	用户输入整数n，计算1!+(1!+2!)+(1!+2!+3!)+…..+(1!+2!+…n!)
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个值n");
            int n = Convert.ToInt32(Console.ReadLine()) ;
            int d = 1;
            int a = 0;
            int b = 0;
            for (int i =1; i<=n; i++ ) {
                d = i * d;
                a = a + d;
                b = b + a;
                
            } 
            Console.WriteLine( n+ "的介乘为"+b);

        }
    }
}
